/**
 * 获取基本 服务器 请求数据地址
 * @param {string} url 请求 URL地址
 * @returns {string} 完整请求地址
 */
const GetBaseUrl = (url: string) => {
  let BASE_URL = ''

  if (process.env.NODE_ENV == 'development') {
    if (url.includes('/api/')) {
      // BASE_URL = 'http://192.168.0.76:54003' // 后端本地地址
      BASE_URL = 'https://psy.ydche.com'
    } else if (url.includes('/iatadatabase/')) {
      BASE_URL = ''
    }
  } else {
    if (url.includes('/api/')) {
      BASE_URL = 'https://psy.ydche.com'
    } else if (url.includes('/iatadatabase/')) {
      BASE_URL = ''
    }
  }
  return `${BASE_URL}${url}`
}

export default GetBaseUrl
